import request from '@/router/axios';

//项目开发阶段设置
//列表
export const getStageList = (params) => {
  return request({
    url: '/api/hg-public/projectphases/list',
    method: 'get',
    params: {
      ...params
    }
  })
}
//新增开发阶段
export const addStage = (row) => {
  return request({
    url: '/api/hg-public/projectphases/save',
    method: 'post',
    data: row
  })
}

//删除开发阶段
export const removeStage = (ids) => {
  return request({
    url: '/api/hg-public/projectphases/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新开发阶段
export const updateStage = (row) => {
  return request({
    url: '/api/hg-public/projectphases/submit',
    method: 'post',
    data: row
  })
}

//获取详情
export const getStage = (id) => {
  return request({
    url: '/api/hg-public/projectphases/detail',
    method: 'get',
    params: {
      id,
    }
  })
}


//项目开发阶段任务设置
//任务分页列表
export const getTaskPage = (current, size, params) => {
  return request({
    url: '/api/hg-public/projectphasestask/page',
    method: 'get',
    params: {
      current, size,
      ...params,
    }
  })
}
//任务列表
export const getTaskList = (params) => {
  return request({
    url: '/api/hg-public/projectphasestask/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增开发阶段任务
export const addTask = (row) => {
  return request({
    url: '/api/hg-public/projectphasestask/save',
    method: 'post',
    data: row
  })
}

//删除开发阶段任务
export const removeTask = (ids) => {
  return request({
    url: '/api/hg-public/projectphasestask/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新开发阶段任务
export const updateTask = (row) => {
  return request({
    url: '/api/hg-public/projectphasestask/submit',
    method: 'post',
    data: row
  })
}

//获取开发阶段任务详情
export const getTask = (id) => {
  return request({
    url: '/api/hg-public/projectphasestask/detail',
    method: 'get',
    params: {
      id,
    }
  })
}


//项目重要时间节点设置
//项目重要时间节点列表
export const getTimeNodeList = () => {
  return request({
    url: '/api/hg-public/timenodes/list',
    method: 'get',
  })
}
//新增项目重要时间节点
export const addTimeNode = (row) => {
  return request({
    url: '/api/hg-public/timenodes/save',
    method: 'post',
    data: row
  })
}

//删除项目重要时间节点
export const removeTimeNode = (ids) => {
  return request({
    url: '/api/hg-public/timenodes/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新项目重要时间节点
export const updateTimeNode = (row) => {
  return request({
    url: '/api/hg-public/timenodes/submit',
    method: 'post',
    data: row
  })
}

//获取项目重要时间节点详情
export const getTimeNode = (id) => {
  return request({
    url: '/api/hg-public/timenodes/detail',
    method: 'get',
    params: {
      id,
    }
  })
}


//产品要求设置
//产品要求列表
export const getPRequirementList = () => {
  return request({
    url: '/api/hg-public/prodectrequirements/list',
    method: 'get',
  })
}
//新增产品要求
export const addPRequirement = (row) => {
  return request({
    url: '/api/hg-public/prodectrequirements/save',
    method: 'post',
    data: row
  })
}

//删除产品要求
export const removePRequirement = (ids) => {
  return request({
    url: '/api/hg-public/prodectrequirements/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新产品要求
export const updatePRequirement = (row) => {
  return request({
    url: '/api/hg-public/prodectrequirements/submit',
    method: 'post',
    data: row
  })
}

//获取产品要求详情
export const getPRequirement = (id) => {
  return request({
    url: '/api/hg-public/prodectrequirements/detail',
    method: 'get',
    params: {
      id,
    }
  })
}


//主机型设置
//主机型列表
export const getMachineList = () => {
  return request({
    url: '/api/hg-public/model/list',
    method: 'get',
  })
}
//新增主机型
export const addMachine = (row) => {
  return request({
    url: '/api/hg-public/model/save',
    method: 'post',
    data: row
  })
}

//删除主机型
export const removeMachine = (ids) => {
  return request({
    url: '/api/hg-public/model/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新主机型
export const updateMachine = (row) => {
  return request({
    url: '/api/hg-public/model/update',
    method: 'post',
    data: row
  })
}

//获取主机型详情
export const getMachine = (id) => {
  return request({
    url: '/api/hg-public/model/detail',
    method: 'get',
    params: {
      id,
    }
  })
}

//成熟度阶段
//成熟度阶段列表
export const getGradeList = () => {
  return request({
    url: '/api/hg-public/maturity/list',
    method: 'get',
  })
}
//新增成熟度阶段
export const addGrade = (row) => {
  return request({
    url: '/api/hg-public/maturity/save',
    method: 'post',
    data: row
  })
}

//删除成熟度阶段
export const removeGrade = (ids) => {
  return request({
    url: '/api/hg-public/maturity/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新成熟度阶段
export const updateGrade = (row) => {
  return request({
    url: '/api/hg-public/maturity/update',
    method: 'post',
    data: row
  })
}

//获取成熟度阶段详情
export const getGrade = (id) => {
  return request({
    url: '/api/hg-public/maturity/detail',
    method: 'get',
    params: {
      id,
    }
  })
}


//设备类型
//设备列表
export const getDeviceList = (params) => {
  return request({
    url: '/api/hg-public/equipmenttype/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增设备
export const addDevice = (row) => {
  return request({
    url: '/api/hg-public/equipmenttype/save',
    method: 'post',
    data: row
  })
}

//删除设备
export const removeDevice = (ids) => {
  return request({
    url: '/api/hg-public/equipmenttype/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新设备
export const updateDevice = (row) => {
  return request({
    url: '/api/hg-public/equipmenttype/update',
    method: 'post',
    data: row
  })
}

//获取设备详情
export const getDevice = (id) => {
  return request({
    url: '/api/hg-public/equipmenttype/detail',
    method: 'get',
    params: {
      id,
    }
  })
}


//点检表基础
//点检表基础列表
export const getChecklistbaseList = (params) => {
  return request({
    url: '/api/hg-public/basecheck/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增点检表基础
export const addChecklistbase = (row) => {
  return request({
    url: '/api/hg-public/basecheck/save',
    method: 'post',
    data: row
  })
}

//删除点检表基础
export const removeChecklistbase = (ids) => {
  return request({
    url: '/api/hg-public/basecheck/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新点检表基础
export const updateChecklistbase = (row) => {
  return request({
    url: '/api/hg-public/basecheck/update',
    method: 'post',
    data: row
  })
}

//获取点检表基础详情
export const getChecklistbase = (id) => {
  return request({
    url: '/api/hg-public/basecheck/detail',
    method: 'get',
    params: {
      id,
    }
  })
}

//质量特性分类
//列表
export const getQualityPage = (current, size, params) => {
  return request({
    url: '/api/hg-public/classify/page',
    method: 'get',
    params: {
      current, size,
      ...params,
    }
  })
}
// 不分页list
export const getQualityList = () => {
  return request({
    url: '/api/hg-public/classify/list',
    method: 'get',
  })
}
//新增开发阶段任务
export const addQuality = (row) => {
  return request({
    url: '/api/hg-public/classify/save',
    method: 'post',
    data: row
  })
}

//删除开发阶段任务
export const removeQuality = (ids) => {
  return request({
    url: '/api/hg-public/classify/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新开发阶段任务
export const updateQuality = (row) => {
  return request({
    url: '/api/hg-public/classify/update',
    method: 'post',
    data: row
  })
}

//获取开发阶段任务详情
export const getQualityDetail = (id) => {
  return request({
    url: '/api/hg-public/classify/detail',
    method: 'get',
    params: {
      id,
    }
  })
}